// ignore_for_file: must_be_immutable, prefer_typing_uninitialized_variables

import 'package:aitao_flutter/common_ui/confirm_btn.dart';
import 'package:aitao_flutter/style/box_style.dart';
import 'package:aitao_flutter/style/color_style.dart';
import 'package:aitao_flutter/style/edgeInsets_style.dart';
import 'package:aitao_flutter/style/radius_style.dart';
import 'package:aitao_flutter/style/text_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class HelloTextInputWindow extends StatefulWidget {
  HelloTextInputWindow({Key? key, required this.inputCallBack})
      : super(key: key);
  var inputCallBack;
  @override
  State<HelloTextInputWindow> createState() => _HelloTextInputWindowState();
}

class _HelloTextInputWindowState extends State<HelloTextInputWindow> {
  TextEditingController textController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Dialog(
        child: Container(
      // width: 300,
      height: 266.w,
      // margin: EdgeInsetsStyle.edgeInsets(30, 0),
      padding: EdgeInsetsStyle.all(20),
      decoration: BoxDecoration(
          borderRadius: RadiusStyle.radiusAll(11),
          color: ColorStyle.whiteColor),
      child: Column(
        children: [
          Row(
            children: [
              GestureDetector(
                child: Text(
                  '取消',
                  style: Styles.greyText_14,
                ),
                onTap: () {
                  // Get.back();
                  Navigator.pop(context);
                },
              ),
              const Spacer(),
              Text(
                '输入打招呼内容',
                style: Styles.normalText_17,
              ),
              const Spacer(),
            ],
          ),
          Box.vBox(17),
          Container(
              padding: EdgeInsetsStyle.only(left: 10, right: 10),
              height: 100.w,
              // width: 200,
              color: ColorStyle.setColor(0xffF0F0F0),
              child: TextField(
                controller: textController,
                maxLines: 3,
                maxLength: 20,
                decoration: const InputDecoration(
                    border: InputBorder.none, hintText: '添加打招呼内容'),
              )),
          Box.vBox(17),
          Container(
            padding: EdgeInsetsStyle.only(left: 45, right: 45),
            child: ConfirmButton(
              title: '添加',
              titleColor: ColorStyle.whiteColor,
              backGroundColor: ColorStyle.themeColor,
              callBack: () {
                Navigator.pop(context);
                widget.inputCallBack(textController.text);
              },
            ),
          )
          // TextField()
        ],
      ),
    ));
  }
}
